using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VWTGEW
    {
        public void SetUpNewRow(ref DataRow dwReturn)
        {

            switch (app.company)
            {
                case "YGR":
                case "TST":
                case "SXN":
                case "UBT":
                default:
                    #region=========
                    dwReturn["WTGMANDANT"] = "00";
                    dwReturn["WTGKUNDNR"] = "00000000";
                    dwReturn["WTGWERK"] = "   ";
                    dwReturn["WTGABT"] = "   ";
                    dwReturn["WTGART"] = "                    ";
                    dwReturn["WTGVAR"] = "  ";
                    dwReturn["WTGAENZL"] = "1";
                    dwReturn["WTGAENB"] = "        ";
                    dwReturn["WTGAEND"] = "0";
                    dwReturn["WTGNEUB"] = "     0  ";
                    dwReturn["WTGNEUD"] = "0";
                    dwReturn["WTGWBBRT"] = "0";
                    dwReturn["WTGWBF"] = "0";
                    dwReturn["WTGFDISM"] = "0";
                    dwReturn["WTGFDLGS"] = "0";
                    dwReturn["WTGFDLFS"] = "0";
                    dwReturn["WTGSFLG"] = "               ";
                    dwReturn["WTGKCOL"] = "0";
                    dwReturn["WTGSMTRS"] = "0";
                    dwReturn["WTGREAPPI"] = "               ";
                    dwReturn["WTGRNAME"] = "               ";
                    dwReturn["WTGCHORE"] = "0";
                    dwReturn["WTGRDENS"] = "0";
                    dwReturn["WTGRDENSTM"] = "0";
                    dwReturn["WTGRDENSTP"] = "0";
                    dwReturn["WTGKARTEN"] = "0";
                    dwReturn["WTGPLATINEN"] = "0";
                    dwReturn["WTGNOPPEN"] = "0";
                    dwReturn["WTGANZRAPP"] = "0";
                    dwReturn["WTGRWRAPH"] = "0";
                    dwReturn["WTGRWRAPB"] = "0";
                    dwReturn["WTGRWRAPHFD"] = "0";
                    dwReturn["WTGRWRAPBFD"] = "0";
                    dwReturn["WTGPANELS"] = "000";
                    dwReturn["WTGSHEDS"] = "0";
                    dwReturn["WTGNFLRH"] = "0";
                    dwReturn["WTGNFLRA"] = "   ";
                    dwReturn["WTGNFTOLM"] = "0";
                    dwReturn["WTGNFTOLP"] = "0";
                    dwReturn["WTGMFLRH"] = "0";
                    dwReturn["WTGMFLRA"] = "   ";
                    dwReturn["WTGMFTOLM"] = "0";
                    dwReturn["WTGMFTOLP"] = "0";
                    dwReturn["WTGHFLRH"] = "0";
                    dwReturn["WTGHFLRA"] = "   ";
                    dwReturn["WTGHFTOLM"] = "0";
                    dwReturn["WTGHFTOLP"] = "0";
                    dwReturn["WTGFILLER"] = "                                                  ";
                    #endregion
                    break;
                case "JLT":
                    break;
            }
        }
        public void MapWTGEW(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }
        public void SaveWTGEW(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryWTGEW(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }

            MapWTGEW(ref dwLocal, dwData);

            if (!flgExist)
            {
                InsertWTGEW(dwLocal);
            }
            UpdateWTGEW(dwLocal);
        }
        public void InsertWTGEW(DataRow dwData, string ITXDBVERSION = "50.24")
        { 
            dwData["WTGNEUB"] = app.User;
            dwData["WTGNEUD"] = date;
            or1 = OracleDB.CreateCommand();
            switch (app.company)
            {
                case "JLT":
                    or1.CommandText = "INSERT INTO WTGEW(WTGMANDANT, WTGKUNDNR, WTGWERK, WTGABT, WTGART, WTGVAR, WTGAENZL, WTGAENB, WTGAEND, WTGNEUB, WTGNEUD, WTGWBBRT, WTGWBF, WTGFDISM, WTGFDLGS, WTGFDLFS, WTGSFLG, WTGKCOL, WTGSMTRS, WTGREAPPI, WTGRNAME, WTGCHORE, WTGRDENS, WTGRDENSTM, WTGRDENSTP, WTGKARTEN, WTGPLATINEN, WTGNOPPEN, WTGANZRAPP, WTGRWRAPH, WTGRWRAPB, WTGRWRAPHFD, WTGRWRAPBFD, WTGPANELS, WTGSHEDS, WTGNFLRH, WTGNFLRA, WTGNFTOLM, WTGNFTOLP, WTGMFLRH, WTGMFLRA, WTGMFTOLM, WTGMFTOLP, WTGHFLRH, WTGHFLRA, WTGHFTOLM, WTGHFTOLP, WTGFILLER)"
                    + "VALUES (:WTGMANDANT, '00000000', '   ', '   ', :WTGART, :WTGVAR, 1, '        ', 0, '        ', 0, 0, 0, 0, 0, 0, 'A              ', '0', 0, '               ', '               ', '0', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '000', '0', 0, '   ', 0, 0, 0, '   ', 0, 0, 0, '   ', 0, 0, '                                                  ')";
                    or1.Parameters.Add("WTGMANDANT", OracleType.NVarChar).Value = dwData["WTGMANDANT"].ToString();
                    or1.Parameters.Add("WTGART", OracleType.NVarChar).Value = dwData["WTGART"].ToString();
                    or1.Parameters.Add("WTGVAR", OracleType.NVarChar).Value = dwData["WTGVAR"].ToString();
                    break;
                case "YGR":
                case "TST":
                case "SXN":
                case "UBT":
                default:
                    or1.CommandText = "INSERT INTO WTGEW ( WTGMANDANT,WTGKUNDNR,WTGWERK,WTGABT,WTGART,WTGVAR,WTGAENZL,WTGAENB,WTGAEND,WTGNEUB,WTGNEUD,WTGWBBRT,WTGWBF,WTGFDISM,WTGFDLGS,WTGFDLFS,WTGSFLG,WTGKCOL,WTGSMTRS,WTGREAPPI,WTGRNAME,WTGCHORE,WTGRDENS,WTGRDENSTM,WTGRDENSTP,WTGKARTEN,WTGPLATINEN,WTGNOPPEN,WTGANZRAPP,WTGRWRAPH,WTGRWRAPB,WTGRWRAPHFD,WTGRWRAPBFD,WTGPANELS,WTGSHEDS,WTGNFLRH,WTGNFLRA,WTGNFTOLM,WTGNFTOLP,WTGMFLRH,WTGMFLRA,WTGMFTOLM,WTGMFTOLP,WTGHFLRH,WTGHFLRA,WTGHFTOLM,WTGHFTOLP,WTGFILLER)"
                        + " VALUES (:WTGMANDANT:,:WTGKUNDNR:,:WTGWERK:,:WTGABT:,:WTGART:,:WTGVAR:,:WTGAENZL:,:WTGAENB:,:WTGAEND:,:WTGNEUB:,:WTGNEUD:,:WTGWBBRT:,:WTGWBF:,:WTGFDISM:,:WTGFDLGS:,:WTGFDLFS:,:WTGSFLG:,:WTGKCOL:,:WTGSMTRS:,:WTGREAPPI:,:WTGRNAME:,:WTGCHORE:,:WTGRDENS:,:WTGRDENSTM:,:WTGRDENSTP:,:WTGKARTEN:,:WTGPLATINEN:,:WTGNOPPEN:,:WTGANZRAPP:,:WTGRWRAPH:,:WTGRWRAPB:,:WTGRWRAPHFD:,:WTGRWRAPBFD:,:WTGPANELS:,:WTGSHEDS:,:WTGNFLRH:,:WTGNFLRA:,:WTGNFTOLM:,:WTGNFTOLP:,:WTGMFLRH:,:WTGMFLRA:,:WTGMFTOLM:,:WTGMFTOLP:,:WTGHFLRH:,:WTGHFLRA:,:WTGHFTOLM:,:WTGHFTOLP:,:WTGFILLER:)";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData); 
                    break;
            }
            Connect2Proxy(or1); 
        }
        public override string BATCHINSERT(DataRow dwData)
        {
            dwData["WTGNEUB"] = app.User;
            dwData["WTGNEUD"] = date;
            string value = "";
            switch (app.company)
            {
                default:
                case "SXN":
                case "YGR":
                case "TST":
                    value = "INTO WTGEW  "
                        + " VALUES (:WTGMANDANT:,:WTGKUNDNR:,:WTGWERK:,:WTGABT:,:WTGART:,:WTGVAR:,:WTGAENZL:,:WTGAENB:,:WTGAEND:,:WTGNEUB:,:WTGNEUD:,:WTGWBBRT:,:WTGWBF:,:WTGFDISM:,:WTGFDLGS:,:WTGFDLFS:,:WTGSFLG:,:WTGKCOL:,:WTGSMTRS:,:WTGREAPPI:,:WTGRNAME:,:WTGCHORE:,:WTGRDENS:,:WTGRDENSTM:,:WTGRDENSTP:,:WTGKARTEN:,:WTGPLATINEN:,:WTGNOPPEN:,:WTGANZRAPP:,:WTGRWRAPH:,:WTGRWRAPB:,:WTGRWRAPHFD:,:WTGRWRAPBFD:,:WTGPANELS:,:WTGSHEDS:,:WTGNFLRH:,:WTGNFLRA:,:WTGNFTOLM:,:WTGNFTOLP:,:WTGMFLRH:,:WTGMFLRA:,:WTGMFTOLM:,:WTGMFTOLP:,:WTGHFLRH:,:WTGHFLRA:,:WTGHFTOLM:,:WTGHFTOLP:,:WTGFILLER:)";
                    value = INTEXDBC.InjectData(value, dwData);
                    break;
            }
            return value;
        }
        public void DeleteWTGEW(string client, string art, string var)
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE WTGEW WHERE   "
            + "  WTGMANDANT=:WTGMANDANT AND WTGART=:WTGART AND WTGVAR=:WTGVAR";
            or1.Parameters.Add("WTGMANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("WTGART", OracleType.NVarChar).Value = art;
            or1.Parameters.Add("WTGVAR", OracleType.NVarChar).Value = var;
            Connect2Proxy(or1);
        }
        public void DWTGEW01(DataRow dwData)
        {

            or1 = OracleDB.CreateCommand();

            or1.CommandText = "DELETE WTGEW    "
            + "  WHERE WTGMANDANT=:WTGMANDANT: AND WTGART=:WTGART: AND WTGVAR=:WTGVAR:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
             Connect2Proxy(or1); 
        }
        public DataSet QueryWTGEW(DataRow dwData, int option = 1)
        {
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    QWTGEW01(dwData);
                    break;
                case 2:
                    QWTGEW02(dwData);
                    break;
            }
            return SResult;
        }
        public DataSet QWTGEW01(DataRow dwData)
        {

            or1 = OracleDB.CreateCommand();

            or1.CommandText = "SELECT * FROM WTGEW    "
            + "  WHERE WTGMANDANT=:WTGMANDANT: AND WTGART=:WTGART: AND WTGVAR=:WTGVAR:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1); 
            SResult.Tables[0].TableName = TableName; 

            return SResult;
        }
        public DataSet QWTGEW02(DataRow dwData)
        {

            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT DISTINCT WD.WDAUFKRS,WDAUFLFD,WDAUFPOS,WDSA,WDUPOS,W.* FROM WDECK  WD "
           + " JOIN WTGEW W ON WDART=W.WTGART AND WDVAR=W.WTGVAR "
           + " WHERE WDMANDANT=:WDMANDANT: AND WDSA='K' AND WDTYP='B' AND WDWAKZ='F' AND WDAUFKRS=:WDAUFKRS:  AND WDAUFLFD=:WDAUFLFD:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public void UpdateWTGEW(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            if (option == 0)
            {
                switch (app.company)
                {
                    case "YGR":
                    case "TST":
                    case "SXN":
                    case "UBT":
                    default:
                        UWTGEW02(dwData);
                        break;
                    case "JLT":
                        UWTGEW01(dwData);
                        break;
                }
            }

        }
        public void UWTGEW01(DataRow dwData)
        {
            dwData["WTGAENB"] = app.User;
            dwData["WTGAEND"] = date;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "UPDATE WTGEW SET "
                + "WTGMANDANT=:WTGMANDANT,"
                + "WTGKUNDNR=:WTGKUNDNR,"
                + "WTGWERK=:WTGWERK,"
                + "WTGABT=:WTGABT,"
                + "WTGART=:WTGART,"
                + "WTGVAR=:WTGVAR,"
                + "WTGAENZL=WTGAENZL+1,"
                + "WTGAENB=:WTGAENB,"
                + "WTGAEND=:WTGAEND,"
                + "WTGNEUB=:WTGNEUB,"
                + "WTGNEUD=:WTGNEUD,"
                + "WTGWBBRT=:WTGWBBRT,"
                + "WTGWBF=:WTGWBF,"
                + "WTGFDISM=:WTGFDISM,"
                + "WTGFDLGS=:WTGFDLGS,"
                + "WTGFDLFS=:WTGFDLFS,"
                + "WTGSFLG=:WTGSFLG,"
                + "WTGKCOL=:WTGKCOL,"
                + "WTGSMTRS=:WTGSMTRS,"
                + "WTGREAPPI=:WTGREAPPI,"
                + "WTGRNAME=:WTGRNAME,"
                + "WTGCHORE=:WTGCHORE,"
                + "WTGRDENS=:WTGRDENS,"
                + "WTGRDENSTM=:WTGRDENSTM,"
                + "WTGRDENSTP=:WTGRDENSTP,"
                + "WTGKARTEN=:WTGKARTEN,"
                + "WTGPLATINEN=:WTGPLATINEN,"
                + "WTGNOPPEN=:WTGNOPPEN,"
                + "WTGANZRAPP=:WTGANZRAPP,"
                + "WTGRWRAPH=:WTGRWRAPH,"
                + "WTGRWRAPB=:WTGRWRAPB,"
                + "WTGRWRAPHFD=:WTGRWRAPHFD,"
                + "WTGRWRAPBFD=:WTGRWRAPBFD,"
                + "WTGPANELS=:WTGPANELS,"
                + "WTGSHEDS=:WTGSHEDS,"
                + "WTGNFLRH=:WTGNFLRH,"
                + "WTGNFLRA=:WTGNFLRA,"
                + "WTGNFTOLM=:WTGNFTOLM,"
                + "WTGNFTOLP=:WTGNFTOLP,"
                + "WTGMFLRH=:WTGMFLRH,"
                + "WTGMFLRA=:WTGMFLRA,"
                + "WTGMFTOLM=:WTGMFTOLM,"
                + "WTGMFTOLP=:WTGMFTOLP,"
                + "WTGHFLRH=:WTGHFLRH,"
                + "WTGHFLRA=:WTGHFLRA,"
                + "WTGHFTOLM=:WTGHFTOLM,"
                + "WTGHFTOLP=:WTGHFTOLP,"
                + "WTGFILLER=:WTGFILLER "
                + " WHERE WTGMANDANT=:WTGMANDANT AND WTGART=:WTGART  AND WTGVAR=:WTGVAR ";
            or1.Parameters.Add("WTGMANDANT", OracleType.NVarChar).Value = dwData["WTGMANDANT"].ToString();
            or1.Parameters.Add("WTGKUNDNR", OracleType.NVarChar).Value = dwData["WTGKUNDNR"].ToString();
            or1.Parameters.Add("WTGWERK", OracleType.NVarChar).Value = dwData["WTGWERK"].ToString();
            or1.Parameters.Add("WTGABT", OracleType.NVarChar).Value = dwData["WTGABT"].ToString();
            or1.Parameters.Add("WTGART", OracleType.NVarChar).Value = dwData["WTGART"].ToString();
            or1.Parameters.Add("WTGVAR", OracleType.NVarChar).Value = dwData["WTGVAR"].ToString();
            or1.Parameters.Add("WTGAENZL", OracleType.NVarChar).Value = dwData["WTGAENZL"].ToString();
            or1.Parameters.Add("WTGAENB", OracleType.NVarChar).Value = dwData["WTGAENB"].ToString();
            or1.Parameters.Add("WTGAEND", OracleType.NVarChar).Value = dwData["WTGAEND"].ToString();
            or1.Parameters.Add("WTGNEUB", OracleType.NVarChar).Value = dwData["WTGNEUB"].ToString();
            or1.Parameters.Add("WTGNEUD", OracleType.NVarChar).Value = dwData["WTGNEUD"].ToString();
            or1.Parameters.Add("WTGWBBRT", OracleType.NVarChar).Value = dwData["WTGWBBRT"].ToString();
            or1.Parameters.Add("WTGWBF", OracleType.NVarChar).Value = dwData["WTGWBF"].ToString();
            or1.Parameters.Add("WTGFDISM", OracleType.NVarChar).Value = dwData["WTGFDISM"].ToString();
            or1.Parameters.Add("WTGFDLGS", OracleType.NVarChar).Value = dwData["WTGFDLGS"].ToString();
            or1.Parameters.Add("WTGFDLFS", OracleType.NVarChar).Value = dwData["WTGFDLFS"].ToString();
            or1.Parameters.Add("WTGSFLG", OracleType.NVarChar).Value = dwData["WTGSFLG"].ToString();
            or1.Parameters.Add("WTGKCOL", OracleType.NVarChar).Value = dwData["WTGKCOL"].ToString();
            or1.Parameters.Add("WTGSMTRS", OracleType.NVarChar).Value = dwData["WTGSMTRS"].ToString();
            or1.Parameters.Add("WTGREAPPI", OracleType.NVarChar).Value = dwData["WTGREAPPI"].ToString();
            or1.Parameters.Add("WTGRNAME", OracleType.NVarChar).Value = dwData["WTGRNAME"].ToString();
            or1.Parameters.Add("WTGCHORE", OracleType.NVarChar).Value = dwData["WTGCHORE"].ToString();
            or1.Parameters.Add("WTGRDENS", OracleType.NVarChar).Value = dwData["WTGRDENS"].ToString();
            or1.Parameters.Add("WTGRDENSTM", OracleType.NVarChar).Value = dwData["WTGRDENSTM"].ToString();
            or1.Parameters.Add("WTGRDENSTP", OracleType.NVarChar).Value = dwData["WTGRDENSTP"].ToString();
            or1.Parameters.Add("WTGKARTEN", OracleType.NVarChar).Value = dwData["WTGKARTEN"].ToString();
            or1.Parameters.Add("WTGPLATINEN", OracleType.NVarChar).Value = dwData["WTGPLATINEN"].ToString();
            or1.Parameters.Add("WTGNOPPEN", OracleType.NVarChar).Value = dwData["WTGNOPPEN"].ToString();
            or1.Parameters.Add("WTGANZRAPP", OracleType.NVarChar).Value = dwData["WTGANZRAPP"].ToString();
            or1.Parameters.Add("WTGRWRAPH", OracleType.NVarChar).Value = dwData["WTGRWRAPH"].ToString();
            or1.Parameters.Add("WTGRWRAPB", OracleType.NVarChar).Value = dwData["WTGRWRAPB"].ToString();
            or1.Parameters.Add("WTGRWRAPHFD", OracleType.NVarChar).Value = dwData["WTGRWRAPHFD"].ToString();
            or1.Parameters.Add("WTGRWRAPBFD", OracleType.NVarChar).Value = dwData["WTGRWRAPBFD"].ToString();
            or1.Parameters.Add("WTGPANELS", OracleType.NVarChar).Value = dwData["WTGPANELS"].ToString();
            or1.Parameters.Add("WTGSHEDS", OracleType.NVarChar).Value = dwData["WTGSHEDS"].ToString();
            or1.Parameters.Add("WTGNFLRH", OracleType.NVarChar).Value = dwData["WTGNFLRH"].ToString();
            or1.Parameters.Add("WTGNFLRA", OracleType.NVarChar).Value = dwData["WTGNFLRA"].ToString();
            or1.Parameters.Add("WTGNFTOLM", OracleType.NVarChar).Value = dwData["WTGNFTOLM"].ToString();
            or1.Parameters.Add("WTGNFTOLP", OracleType.NVarChar).Value = dwData["WTGNFTOLP"].ToString();
            or1.Parameters.Add("WTGMFLRH", OracleType.NVarChar).Value = dwData["WTGMFLRH"].ToString();
            or1.Parameters.Add("WTGMFLRA", OracleType.NVarChar).Value = dwData["WTGMFLRA"].ToString();
            or1.Parameters.Add("WTGMFTOLM", OracleType.NVarChar).Value = dwData["WTGMFTOLM"].ToString();
            or1.Parameters.Add("WTGMFTOLP", OracleType.NVarChar).Value = dwData["WTGMFTOLP"].ToString();
            or1.Parameters.Add("WTGHFLRH", OracleType.NVarChar).Value = dwData["WTGHFLRH"].ToString();
            or1.Parameters.Add("WTGHFLRA", OracleType.NVarChar).Value = dwData["WTGHFLRA"].ToString();
            or1.Parameters.Add("WTGHFTOLM", OracleType.NVarChar).Value = dwData["WTGHFTOLM"].ToString();
            or1.Parameters.Add("WTGHFTOLP", OracleType.NVarChar).Value = dwData["WTGHFTOLP"].ToString();
            or1.Parameters.Add("WTGFILLER", OracleType.NVarChar).Value = dwData["WTGFILLER"].ToString();
            Connect2Proxy(or1);
        }
        public void UWTGEW02(DataRow dwData)
        {
            dwData["WTGAENB"] = app.User;
            dwData["WTGAEND"] = date;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "UPDATE WTGEW SET WTGMANDANT=:WTGMANDANT:,WTGKUNDNR=:WTGKUNDNR:,WTGWERK=:WTGWERK:,WTGABT=:WTGABT:,WTGART=:WTGART:,WTGVAR=:WTGVAR:,WTGAENZL=WTGAENZL+1,WTGAENB=:WTGAENB:,WTGAEND=:WTGAEND:,WTGNEUB=:WTGNEUB:,WTGNEUD=:WTGNEUD:,WTGWBBRT=:WTGWBBRT:,WTGWBF=:WTGWBF:,WTGFDISM=:WTGFDISM:,WTGFDLGS=:WTGFDLGS:,WTGFDLFS=:WTGFDLFS:,WTGSFLG=:WTGSFLG:,WTGKCOL=:WTGKCOL:,WTGSMTRS=:WTGSMTRS:,WTGREAPPI=:WTGREAPPI:,WTGRNAME=:WTGRNAME:,WTGCHORE=:WTGCHORE:,WTGRDENS=:WTGRDENS:,WTGRDENSTM=:WTGRDENSTM:,WTGRDENSTP=:WTGRDENSTP:,WTGKARTEN=:WTGKARTEN:,WTGPLATINEN=:WTGPLATINEN:,WTGNOPPEN=:WTGNOPPEN:,WTGANZRAPP=:WTGANZRAPP:,WTGRWRAPH=:WTGRWRAPH:,WTGRWRAPB=:WTGRWRAPB:,WTGRWRAPHFD=:WTGRWRAPHFD:,WTGRWRAPBFD=:WTGRWRAPBFD:,WTGPANELS=:WTGPANELS:,WTGSHEDS=:WTGSHEDS:,WTGNFLRH=:WTGNFLRH:,WTGNFLRA=:WTGNFLRA:,WTGNFTOLM=:WTGNFTOLM:,WTGNFTOLP=:WTGNFTOLP:,WTGMFLRH=:WTGMFLRH:,WTGMFLRA=:WTGMFLRA:,WTGMFTOLM=:WTGMFTOLM:,WTGMFTOLP=:WTGMFTOLP:,WTGHFLRH=:WTGHFLRH:,WTGHFLRA=:WTGHFLRA:,WTGHFTOLM=:WTGHFTOLM:,WTGHFTOLP=:WTGHFTOLP:,WTGFILLER=:WTGFILLER:"
                                + " WHERE WTGMANDANT=:WTGMANDANT: AND WTGART=:WTGART:  AND WTGVAR=:WTGVAR: ";

            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        }
    }
}
